/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ipti.br.tag.bo;

import org.ipti.br.tag.dao.CampaignFacade;
import org.ipti.br.tag.entity.Campaign;
import org.ipti.br.tag.entity.Human;
import org.ipti.br.tag.entity.Unity;
import org.ipti.br.tag.entity.enums.CampaignType;
import java.io.Serializable;
import java.util.Calendar;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.inject.Inject;

/**
 *
 * @author FelipeMSX
 */
@Stateless
public class CampaignBO implements Serializable {
    
    @Inject
    private CampaignFacade campaignFacade;
    
    public void create(Campaign campaign) {
        getCampaignFacade().create(campaign);
    }

    public void edit(Campaign campaign) {
        getCampaignFacade().edit(campaign);
    }

    public void remove(Campaign campaign) {
        getCampaignFacade().remove2(campaign);
    }

    public Campaign find(Object id) {
        return getCampaignFacade().find(id);
    }

    public List<Campaign> findAll() {
        return getCampaignFacade().findAll();
    }
    
    public CampaignFacade getCampaignFacade() {
        return campaignFacade;
    }
    
    public List<Campaign> findAllCampaign(CampaignType campaignType){
        return campaignFacade.findAllCampaign(campaignType);
    }
    
    public Campaign findCurrentCampaign(CampaignType campaignType){
        return campaignFacade.findLastCampaing( campaignType );
    }
    
    public Long countLastAnemics() {
        
        return 0L;
    }
    
//    public List<Object[]> getCampaignListHb(Unity unity, Campaign campaign){
//        return campaignFacade.getCampaignListHb(unity, campaign);
//    }
//    
//    public List<Object[]> getCampaignListWeigthAndHeight(Unity unity, Campaign campaign){
//        return campaignFacade.getCampaignListWeigthAndHeight(unity, campaign);
//    }
    
//    public List<Human> getx(Unity unity, Campaign campaign){
//        return campaignFacade.getx(unity, campaign);
//    }

    public List<Campaign> modifiedPerfFreqBetweenDate(Calendar initialDate, Calendar finalDate, Long serialNumber) {
        return getCampaignFacade().modifiedPerfFreqBetweenDate(initialDate, finalDate, serialNumber);
    }
}
